<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<button id="send">send</button><br/>
<textarea rows="10" cols="40" id="content"></textarea>
<script type="text/javascript">
	var ws=new WebSocket("ws://localhost:8080/websocket-spring/ws/test1");
	ws.onmessage=function(event){
		var t=document.createTextNode(event.data);
		document.getElementById("content").appendChild(t);
	}
	var sendBtn=document.getElementById("send");
	sendBtn.onclick=function(){
		ws.send("I am john");
	}
</script>
</body>
</html>